﻿Option Strict On
Option Explicit On

Imports EM.BaseApplication
Imports EM.System


Namespace DataClasses
    Public Class EMUser
        Inherits BaseData

        Public Sub New(ByVal SessionKey As SessionKey)
            MyBase.New(SessionKey)
        End Sub

        Public Property ID As Int64
        Public Property Code As String
        Public Property CompanyID As Int64
        Public Property UserRegistrationID As Int64
        Public Property Name As String
        Public Property Description As String
        Public Property Phone As String
        Public Property Email As String
        'ADD Rest of Properties

        Private myCompany As DataClasses.Company

        'TODO: For Foreign key relationships, add ReadOnly Properties like below. 
        Public ReadOnly Property Company As DataClasses.Company
            Get
                If myCompany Is Nothing AndAlso CompanyID > 0 Then
                    myCompany = New DataClasses.Company(SessionKey)
                    myCompany.Read(CompanyID)
                End If

                Return myCompany
            End Get
        End Property

        'ADD Read() & POST() Methods.
    End Class
End Namespace

